#include "mainwindow.h"
#include <QApplication>
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
/*
 *  2022-11-08  13:45   by  CYL
    Based on Ubuntu18.04 + QT5.9.5 + OpenCV4.5.3
    Used Qmake.
*/
int main(int argc, char *argv[])
{
//    QApplication a(argc, argv);
//    MainWindow w;
//    w.show();

//    if ( argc != 2 )
//        {
//            printf("usage: DisplayImage.out <Image_Path>\n");
//            return -1;
//        }
        Mat image;
//      image = imread( argv[1], 1 );
        String picPath="/home/cao/GITEE/qt4-learn/demo1/sea.jpeg";
        cout<<picPath<<endl;

        image = imread( picPath, 1 );
        if ( !image.data )
        {
            printf("No image data \n");
            return -1;
        }
        namedWindow("Display Image", WINDOW_AUTOSIZE );
        imshow("Display Image", image);
        waitKey(0);
        return 0;
        //    return a.exec();
}
